Made some changes

Added ByRef to outdata arrays.