Fixed bugs, changed syntax, updated comments

Removed ! syntax and changed to "not".
Fixed a few bugs, in particular with else.
More detailed comments.