changed size of rect, created normalizeMatrix for normalisation and calculating intensities at grid-points only