Some heuristic to ensure that the objects are not hidden behind objects larger than them would be a good improvement for future iterations.