added rev1 of the script
Merge branch 'r1'