improve pi.c