Fixed bug where state wasn't used.
Added a license file