added return to traverse and added parentheses to tests