Added some vars that weren't there before, needs testing.