The syntax is correct but I made a logical error since balance is being compared to itself (as opposed to the new balance at the end).