Added code snippet for the core functionality