Moved internal variables to the inside of function.
Added gitignore file.