Added toString(), tests for it, and simplified some return statements.