Refactored slider JS~