basically copy/paste layer method from polycharts