Added pregen code