checking domain and range