I guess whoever wrote that code in the first place didn't know about moving self. I've changed sorted and grade to take borrowed references to self instead.