final working problem with stdv line up
Fixed bug due to bad initialization of matrix