working code. works with lsm and pots at the same time