added a pi function