implemented panTo function for locations thanks to Josh