moved variables settings outside loog