joined tables for calculation; cleaned up variable names