tried to add sliding function