complete first half of program + unit tests