Finished ex2.
Fixed bugs to pass all tests (previously, 3, 4 were failing.)