corrected javascript projection sample