private static void addFunction(String s, Scanner sc) {
    // TODO Auto-generated method stub
    String name="";
    ArrayList<String> rets = new ArrayList<String>();
    ArrayList<String> args = new ArrayList<String>();
    LinkedList<String> code = new LinkedList<String>();
    StringTokenizer st = new StringTokenizer(s);
    String vtype="",vname="";
    st.nextToken();
    while(st.hasMoreTokens()) {
      vtype = st.nextToken();
      vname = st.nextToken();
      if(!(vtype.equals("many")||vtype.equals("much"))) {
        break;
      }
      if(vtype.equals("many")&&vname.endsWith("s")) {
        rets.add(vname);
      } else if (vtype.equals("much")&&!vname.endsWith("s")) {
        rets.add(vname);
      } else {
        System.out.printf("much bad type. %s is not %s.\n", vname,vtype);
        System.exit(-1);
      }
    }
    name=new String(vtype);
    if(!vname.equals("is")) {
      vtype=vname;
      vname=st.nextToken();
      while(st.hasMoreTokens()) {
        if(!(vtype.equals("much")||vtype.equals("many"))) {
          break;
        }
        if(vtype.equals("many")&&vname.endsWith("s")) {
          args.add(vname);
        } else if (vtype.equals("much")&&!vname.endsWith("s")) {
          args.add(vname);
        } else {
          System.out.printf("much bad type. %s is not %s.\n", vname,vtype);
          System.exit(-1);
        }
        vtype=st.nextToken();
        if(!st.hasMoreTokens()) {
          break;
        }
        vname=st.nextToken();
      }
    }
    s=sc.nextLine();
    linenum++;
    while(!s.trim().startsWith("okay")) {
      code.add(s);
      s=sc.nextLine();
      linenum++;
    }
    Function f = new Function(new String(name),code,args.toArray(new String[args.size()]),rets.toArray(new String[rets.size()]));
    functions.add(f);
  }