shell sort functional works