Added upper case characters to the genCode function