replace p with puts