Made some variables get re-set when the window resizes to keep other calculations accurate.