Updated with unittests- now passes expectation