shuffle program done recursively