almost working
tests passing