Updated the version of the 'find' algorithm to the one from the book