Debugged insertion sort. Works for basic cases.