source code for CS200 PA3 assignment