putting insert function back into add function