also lint test files
more tests
added tests and cleaned up the code