added basic support for layers