function for dest, closes #15