new check algorithm