some large changes, i am actually not going to change the layout of pointer_state