formatting
found that $a$ is always positive during reduction, so there is no need to mask it