finished builiding main functionality for slider