Added gen.py for generating ETC matrices