Added new ligic to get sex using id and modified widows