Added sort and search code to pass test