Improved comments

> Also cleaned up code.