update to new code