Added license, fixed a few kinks