Changed one array to list.  Small refactorings