added Generation of k