added recenter code