Louisville gunman legally purchased firearm used in shooting