adding same state as scala version