adding zoom/pan handlers; code cleanup