Implemented countingsort