Stroke algorithm