Addet my version of Max code. I call it max2.0