updated for pinch and zoom