Algorithm helps detect heart abnormalities