updated with current code