Fixed bugs. Added another example, for which the tests are passing correctly.