Adding solution for the programming assignment