implemented repetitive use of cmd...

-added unit tests