fixed focus movement and flickering
removed index_of function