Added support for multiple materials