Review previous written codes used on another file, and rewrite for this program