Stable implementation of the output filter. The file reading still needs work, as of now it always reads the first line