Modified programming assignment 2.