added RPI calculation

run it with

```
$ python rpi.py
```