fix doWhile error handling
simplify doWhile
optimise whilst
simplify compliments
docs