Adding insert-fn functionality