Solved the programming assignment