Cleaned up a bit, added/fixed some comments