Daemon half done plus some tests