Added titles; simplified the functions