Finally got assignment 2 quetion 1 to work properly