embryo of 'overlap' function
bugfix 1
accepts custom function