improved amterials routine, reduced code, and elminated unnecesary files