improving the find function