added init value to clear-candidates function
added max-dist to filter