minor pi calc improvement