script to calculate missing rps data