Resolved bug with handleCmd. Now it as changed in if/else if and it is nomore a method. Added new system to end MainMemory and VirtualMemory.