M571 code simplified.