added -v flag to default invocation
updated to use javascript object model