Updated it to use input streams instead of strings for the names