source: https://github.com/otanistudio/swt/blob/master/swoop_squares.html