improved control flow
add commando line parser