my fourth assignment in cs 162 ;)