fixed insert at rank

fixed logic error in second half of insert at rank to where it now
correctly reinserts the elems after the inserted elem.