some cleanup, added a license terms