Also, you only need to do this at all if allok is not already false, so can start with "if allok and "