make missing layers

also add a DEBUG mode