added interval counterbalancing and waitbar cancel option