added 1d state detection