Added more tests, made code stronger