Started to implement zooming

The algorithm is a mess.