just echo the inputs
add some simple check of inputs
fixed some small bugs