implementation of djb's redo, following jekors youtube videos