halfway(?) through conversion to C#