Copied "encoder" from different project. (Don't know why I didn't just work in Git)