added ternary and if to find out payPeriod and time Off vars.