using the check function