Implemented insert method.