fixed some bugs, added tests, made the modules pretty