use parseInt() in some calculations.