sample program changed (varn to be a global var)