last changes from c9 reapplied