added panning functionality