Fixed a bunch of bugs. Tests working more. Submit implemented