changed from length() to size() to avoid loading entire List