finish the generater code