refactored to remove initialized name array