first, minimally working version.

still need to free the block list after each file.
add main.