repaired tests and code