slide logic