updated source code and added a license file