changed file handling to use context manager ; minor style changes
Merge pull request #6 from yoniYalovitsky/context_manager

changed file handling to use context manager ; minor style changes