Finished the reward function.
Finished the feature extraction function and modified pgUpdate function.