I just spent an hour and a half building what I thought was a simplified version of the R-Tree algorithm, until I came across a test case that completely breaks it. The lesson: don’t take shortcuts and just learn the well-known algorithm first.