dynamic arrays so that cmd line arguments work
add free()s