modified command analyze function.