working on whole function type checking