simplified code by any()