fixed global variables bug (ignore global assignments)

added comments and todo