add io routine for csv output
add build dir to makefile