changed main c -> states now