many changes, daemonized, overall smarter