Updated with latest code.