Function to slightly shuffle an array based on a tolerance parameter