Changed ref to out