Rewrite for dot.NET