Implements #115 and #117

@yyhh91  I don’t understand the purpose of the extra loop in the
editCli method, look at the comment i committed.