Whole source commented and cleaned.