Updated search_funct.rb with better user input and fixed bug for infinit loop