Made some kernel variables local