Initial solution to programming assignment