Updated width calculation

Fixed width calculation bug