calculator now updates values and calculates correctly