added useful explanatory comments on how the keygen entity is processed