"This code won't (probably) work with rectangular BBOX! You have to use square BBOX" The code theoretically works with all kinds of bboxes, square or not.
Well, maybe I used few wrong words to explain myself there. It will be MORE tricky to make it work with rectangular BBOX