added cmd line support