Resource reorder code Updated in this branch.