added type check to operators
added type check for if and while