bug in pi program fixed