changed the way slideLength works