Stable version of insert and search