few changes and better scripts