refactored find() method
added comments for functions