refactored perform_slide and now is returning correct output