type checking simple functions