width calculation fix attempt