Adding init logic. state update logic not complete.