added README file and made slight refactoring