Finalizes the insertion algorithm, removes the imperative implementation as it's not more performant than the functional implementation