Code simplifications. Added .gitignore.