Re-wrote scanning and parsing to handle problems from issues #3 and #4
Re-wrote scanning and parsing to handle problems from issues #3 and #4