updated to match current code