Contours function now receive source as an argument