Insert sort routine