this is my solution for the programming assignment