Rewrite some VB6 into C for Ed at vmuxtech