Added type checker to main program, fixed function scope in type
checking functions. Fixed for loop syntax when parsing