Updated to only print the titles once