correct 0 < list.size() to list.size() > 0