Created macro for max projection and histogram calculation on the fly