Updated code with gender