Working on a bit of rectangle detection