Added some lgoic so the cursor stays in the middle of the screen when searching text