Average calculation in place