Changed variables to work with larger sizes of new level