Revised script and wrapper with changes from freq branch