added command line runnable version