basic structure for go back n implemented