Added worst case complexity to insert method