cleanup and passes tests