Modified all 3 parts in the chain to allow for a filename as an argument, instead of stdin