fixing and code cleanup for vb6 ^a.