add comment to check function