initial code for slider