adding back cli functions and writing new tests