Fixed a few bugs, but still not working so well :(
Threshold view and settings screen work!
Still crashes randomly with bad flag error..