modified to deal with the basic IF-statement