Added comments and second function