Filter more generic and flexible, encoding and datatype issues fixed

- Modified the filter to be more generic, handling more than one
datasets, and hanlding sections in various orders.
- Commented code, with function headers
- Fixed the parameter names data type issue
- Characters encoding issues fixed (using from Windows CP1252)