Wrote top-level background process code