Made Simple2D algorithm twice as fast