before trying to list files, make sure the directory exists (avoids NPE)
allow for building a histogram with specified bar widths