modify the code to calculate data for my papers