Implement shell sort