changed block variable name and made block easier to read