core methods updated
layering: depth inverted, correct layer ids