eopl 15 q4: added 'while' and 'not' statements