Code cleand up. Licenses added