Added correct titles and test assertions, cleaned up code