Added license header and cleaned up comments