Initial c# implementation