Added -genall and -rgenall functions