Huge Cleanup + Fixed some bugs (Still incomplete)