Corrected id change
Add and test ordering function