Added Pan functionality