adding some more tests and restructuring