get basic app working; fix threading logic; minor fixes