changed handleOverlapOf so that it make recursive calls