Fixed minor errors in var names and changed file so its executable on the CLI.