added parse method for command string