def list
      begin
        @header = [["", ""]]
        # @header = [[set_color("Item", :white), set_color("Total", :white)], [set_color("=================", :white), set_color("=====", :white)]]
        @green = []
        @yellow = []
        @yellow2 = []
        @green2 = []
        @red = []
        @red2 = []
        read_file.each do |key, value|
          if value['total'] > value['min']
            @green += [[key.titlecase,value['total'], value['total']-value['min']]]
          elsif value['total'] == value['min']
            @yellow += [[key.titlecase,value['total'], value['total']-value['min']]]
          else
            @red += [[key.titlecase,value['total'], value['total']-value['min']]]
          end
        end
        @green.sort_by! { |a,b,c| c }
        @yellow.sort_by! { |a,b,c| c }
        @red.sort_by! { |a,b,c| c }
        @green.reverse!
        @yellow.reverse!
        @red.reverse!
        @green.each { |a,b| @green2 += [[set_color(a, :green), set_color(b, :green)]] }
        @yellow.each { |a,b| @yellow2 += [[set_color(a, :yellow), set_color(b, :yellow)]] }
        @red.each { |a,b| @red2 += [[set_color(a, :red), set_color(b, :red)]] }
        print_table(@header + @green2 + @yellow2 + @red2,{indent: 2})
      rescue Exception => e
        puts "Inventory empty"
      end
    end
def list
      begin
        @header = [["", ""]]
        # @header = [[set_color("Item", :white), set_color("Total", :white)], [set_color("=================", :white), set_color("=====", :white)]]
        @green = []
        @yellow = []
        @yellow2 = []
        @green2 = []
        @red = []
        @red2 = []
        read_file.each do |key, value|
          if value['total'] > value['min']
            @green += [[key.titlecase,value['total'], value['total']-value['min']]]
          elsif value['total'] == value['min']
            @yellow += [[key.titlecase,value['total'], value['total']-value['min']]]
          else
            @red += [[key.titlecase,value['total'], value['total']-value['min']]]
          end
        end
        @green.sort_by! { |a,b,c| c }
        @yellow.sort_by! { |a,b,c| c }
        @red.sort_by! { |a,b,c| c }
        @green.reverse!
        @yellow.reverse!
        @red.reverse!
        @green.each { |a,b| @green2 += [[set_color(a, :green), set_color(b, :green)]] }
        @yellow.each { |a,b| @yellow2 += [[set_color(a, :yellow), set_color(b, :yellow)]] }
        @red.each { |a,b| @red2 += [[set_color(a, :red), set_color(b, :red)]] }
        print_table(@header + @green2 + @yellow2 + @red2,{indent: 2})
      rescue Exception => e
        puts "Inventory empty"
      end
    end
Print a list of all inventory items. Green items are well stocked. Yellow items are at minimum acceptable total. Red items are below minimum acceptable total.