First version of programming assignment 2