Make it obey material costs

That was easier than expected!