Implemented pass-by-ref for array elements