add diagram to README
rename var and do more validation on args