Slightly modified to enhance understandability