insert sort solution