* first revision of .net code and some php minor fixes