made some changes to tanner sort