Added an editpath function