Problem 3 now completely solved

Added some comments to make it neater