modified for 1) outputting redirects 2) langle/rangle