Implement tree for command string