Implemented naive top-k serach.