Island detection and assignment