added element to width() calculation function as an argument