Modified to have states