Added C# and Java versions