Refactored to allow for reading entire CSV file, not just sample, and to be more compatible with Vaadin