Updated the zoom in/out algorithm