added Max Lines, two inputs, better error checking
update VS2012