use dimarrays correctly