Advancing documentation and cleaning up first part of the script