rewrote find to return index