move tick calculations to widget function