Insertion algorithm fixed