programming assignment2 updated with code