Code to complete assignments for CS462