changed append and prepend to use insert method