Tightened up parseTitle and added comments