initial port to c#