Added license, reformat code