works properly now, except for zooming out (also might need to store the variables somewhere else so that the calculations aren't run every frame)