fixed algebra mistake