Now move all inside material function:
And I messed up something
Will post more if i find bug tomorrow.