Implemented first 3 functions of counting sort