more-or-less functioning with main