modified to support state and integration with looper.sh

also fixed some ui issues