change to use reverse rather than using bytebuffer