first pass at assignment 2 solution