Restricted where pan motions can start
Tidied changes