Changed from ARGF to ARGV and added a line that makes it easier to debug outside Automator