Moved lots of variables around