Updated to take into account named command blocks