Attempt to make data transfer smarter -- needs checking\! Untested\!