Finished writing phi_value calculator. Testing now.