initial implementation for insert and search