made findElement function