Reworked and fixed the material system