added command patter (functional)