update functions updated and pan speed modified