Add if statement and a few other flow control operations, plus some minor changes