Added method to properly format phi.