worked on command pattern