cleaned up main js