kev smith 0 Newbie Poster

I am trying to a do a breadth first search in prolog:

breadthfirst([Path | Paths], Finish, Solution) :-
		extend(Path, NewPaths),
		sortPath(NewPaths, Results),
	append(Paths, Results, Paths1),
	breadthfirst(Paths1, Finish, Solution).

My problem is I do not know how to write the sortPath(NewPaths, Results) part. It should sort the path in order by the values given early in the code:

sound(p0,2).
sound(p1,4).
sound(p2,2).
sound(p3,12).
sound(p4,10).
...

So it should sort the path in order by the numbers given in the above peice of code.

Any help at all will be excellent as I need this done by friday! If you do not know the answer but know where I can find out then please also reply.