Here is the code change for PRG pattern.