Added license, added cleaned up code.