Changed the currentWidth variable to be mobile friendly