with a flourish he waved the long whip over his head , but his skill was not so great as his ego , and as he brought the whip low , caressing the ground like a snake , it wrapped securely around his legs .