Moved $widths and $dimensions further down for easier code readability