adapted fix.cs to new requirements
fixed whitespace issue
added support for encoding