I think it might increase readability a little bit if functions are defined before they are used (here `bounding_box` is defined below).