made GPIO pin stuff into functions