Made the calculations happen on keyup.