solve for pi