Fixed previous searching bug and follows the Google C++ Style Guide