use a function to get file size instead of calling stat in main
made part of script directory independent (no cd neccessary)
fix absolute path in function
use mktemp to create filenames
make more directory independent
use minimum file size of a sample to estimate needed files
refactoring
use piped filters to collect files.