Fix #4: Variables passing by reference corrected