Loop optimization. Added run scripts.