Update lsm.py

fixed many things... please check the update of the covariance matrix. Now it will explode...