Metal value function

Not finished