added mean out variable