Cleanup Arduino code

Fixed subtraction.