Improved getCoordinate to scan each visible element one by one until we find one that isn't completely covered