cleaned up script portion