remove trailing whitespace convert to unix line endings and add consume method as well as fix produce method