The order of add round key, shift rows, and sub bytes can be varied to some degree without affecting the final result, as they don’t combine any of the bytes of the state together. That being said, I can’t verify that that function is correct, as it was written a long time ago and appears to be in a semi completed state.