rewrote print reverse using control.monad