Basic cleanup

Add code comments, ensure line width no longer than 80 characters.