added solution to programming assignment 5