script better written + more logic header comments