Changed chain to account for pass-by-value