Updated with some diagnostics