Completing programming assignment 2