rearranged variables for readablitity