Cleaned up all of the complex arithmetic for HETRI.