cleaning up the check function