assign a matrial to boxes