Add license header and add comments