Tidying up the sequence of paths