Add partial reorder function. Still need to write the move part but algorithm in comments.

God… it's awful ^^