fixed mean -> inverse bug