first version of programming assignment 2