updated. added is_state() function