:rocket: updated the averageByTotal behaviour to work with nested arrays