taken and adjusted from pih malawi 'one way sync'