Added test for last methods, added comments and small changes.