Finishing refactoring.
Refactored: argheap now supports pre-allocation of idx list