refactored script, updated README