Use inout parameters and remove parens from if and while conditions