added the full code to add a module

Code fully works.