Added mean method implementation.