add data files with examples
fix logic issues: calculate P, c, betta correctly