added tests, cleaned up my shit