split into two scripts
minor changes