Adding updated source code.Fixed bugs.