adds klei generator and minor changes