Renamed 'equal?' function to 'check'