worked on the return typestate