implemented insert method