added panning and smoothing