simplifying the calculations of console output