further modified script pipeline