fixing code so tests work