refactored scripts file, improved comments