implemented genration variable close #19