updated SLIC code to include merger of small components