- added pi module
- minor fixes to code