Updated for new code