width calculation