using middle_of for guards