Changed some method names, added comments, added a simple test.