add comments
update TypeMismatchError
type check funct third argument (file or string literal)