Added .gitignore
Added comments. Tidied code.