fixed bugs in lambda methods, and added more unit tests. All unit tests are now passing.