added cases for buckets greater than or equal than the length of
sequence; cloning the sequence so that it is not mutated; sorting the
sequence since the algorithm seems to require it
took out the presorting