Changed all unsigned char types to uint8 made some simplifications to superflous code in sort