Why did you move these two variables (phase and index) to the class definition? Do you use them elsewhere, or did you have any issue with them being static?