more precise width calculation