begin fixing extract name function