fixed a typo and coded forwards and backwards methods