updated some cli logic
updated code for CLI purposes