roughly working daemon functionality; now needs GPIO code