Create a projection function