generating some of the code