Beginning of counting sort