search insert position almost same code