Shortened Code

Combined sizing code into a function for better reference