ported Sudipto's changes from master to attributeMatrix (v5) branch