moved initialization of variable in to run instead of main