Switch from using str() to list()