I don't get the flow of this method. Could you add some javadoc to it?