add mean!, which allows pre-allocated output