fixed finding ranges of boxes (also smaller to work on my computer sorry)