There are, though, two more related issues I noticed with this function: the first concerns the readability; the second may be a bug in how a minor entry under certain conditions overrides a previous one. The first, relating to readability: I found it quit difficult to follow the flow of the functionʼs code due to its nesting and idiosyncratic order of condition checking. I want to, therefore, propose a restructured version, which I believe to be functionally equivalent.