Fixed the bug

Bug fixed and the code works. Added home-made normrnd.m to get rid of
the dependency of matlab stats toolbox.