initial implementation
added support for materials