sorts after insertion if needed