Added logic for gender input