working CLI version