tested and fixed issue with calculation

added conversion to integer