Should handle stdin/input files better