Completed sortFun.cpp