-implemented insert function