First draft. Tested and confirmed.