finished ps5-2 of udacity cs215