Factorization of output module.
Fixed syntax error which gave compile error.