added license texts and refactored some variables