This is my answer to programming assignment 2