Added first version of daemon code