Moved the test thing over (dumb idea to have it) and made a mode function