updated reverse.js