fix accel function