Added comments and solved problem 1.4