missing variable definitaions fixed