Added comments explaining why sorting yields complex code