Found error with writing to output file, begun work on pipes