added comments and additional tests