fit, flow & reposition (clear mess up history)

sorry for previous pull request.

this branch has cleared some messed up historty

and submit only the fit, flow & reposition code.