added basic slider
refactored the code