Remove the engaged lock and just poll a flag instead, the lock could interact badly with the rangefinder (for example)
Change the polling behaviour of the running variable to make loop termination still work