added titles and fixed some bugs