function necklace