Completes programming assignment2