added comments and new tests