Final Revision

added tests in main
formatting refactor