fixed method, all tests pass