Implement sort and Mtc functions