passing state around