finishing the slide function