working except for a final saving problem with the matrial objects