Restored code from the author repository due I was wrong when I resolved the conflicts