cleaned up main a little more