Continued iteration of lastOf implementation