modified script to explicit some variables

cleaned up a bit