reorder funciton and remove withe space