Rename "last" variable to "is_last_child" for clarity