1. change the functions for storing policy.
2. fix some bugs to make the learning algorithm runs correctly.