fix envy calculation