fix operator precedence, complete test case