reorder_sb function debugging