Implemented type checking of for loops