use optparse instead of command line switch - fixes #60