add some tests and clean up bunch of stuff