Pass by reference code from class