Improved runtime of isSequential