allocNodes n heap = (heap2, a:as)
    where 
    (heap1, as) = allocNodes (n - 1) heap
    (heap2, a) = hAlloc heap1 (NInd hNull)
allocNodes n heap = (heap2, a:as)
    where 
    (heap1, as) = allocNodes (n - 1) heap
    (heap2, a) = hAlloc heap1 (NInd hNull)
allocNodes n heap = (heap2, a:as)
    where 
    (heap1, as) = allocNodes (n - 1) heap
    (heap2, a) = hAlloc heap1 (NInd hNull)