Implement insert sort