Added shebang and corrected argument ordering and variable declaration