Implemented simple type checking