added comments and tested again