added the totalWidth variable