add var for local variables and remove debug code