First version of programming assignment2