Code Snippet for the M2 project