copied and pasted into reastBBox_fix_sv