pass_gen.pl: simplified the office formats with functions