working through cs169.1x homework 4