Fixed grade implementation, now estesort seems to work