updated notices in README and refactored code slightly