for program assignment 2.