Moved stage variable to top of updateStage method for clarity