Updated to pass all tests and minimum code coverage