Fix rules bugs, integrate with threads (single thread in this case), add start and pause buttons