added license

Added a license and removed extraneous code. Added comments