updated determineCmd method in Parser using swtich case