Update lsm.py

updated to last version