added slider function