His permutation function drops 0 on 0. Otherwise it is good.
I do not understand the replacement for the gradient table though...how does that work ?