added volatile to external variables in wheel.c