Updated to match current code..