Added code to find the highest-priority command in a given line