buildpt n acc = (acc'', PtNode x lt rt)
    where
        midp = cmidp 0 n
        (x : acc', lt) = buildpt (pred midp) acc
        (acc'', rt) = buildpt (n - midp) acc'
buildpt n acc = (acc'', PtNode x lt rt)
    where
        midp = cmidp 0 n
        (x : acc', lt) = buildpt (pred midp) acc
        (acc'', rt) = buildpt (n - midp) acc'
buildpt n acc = (acc'', PtNode x lt rt)
    where
        midp = cmidp 0 n
        (x : acc', lt) = buildpt (pred midp) acc
        (acc'', rt) = buildpt (n - midp) acc'