added functions to reorder tasks in respect to a vector of fields. tests pass.