added boolean expressions and fixed while/if statements