sort out the paths