updated calc/refresh functionality