Cleaning up accel function