Example code for projection method