key computation first version