Working Projection Function

fixed the projection function