Changed tick logic to be more self contained