Minor cleanup

minor optimization to the projection function and use a worker for the local file example