cleanup and improve readability with parentheses
solution Q2