assignment 3 for CS42