added some changes to martin's code to handle female names