based on CS 344 Fall 2014 assignment 4 at OSU