completely reworked boxfinding. restored some heuristics parameters