started on rewriting insertion