various improvements, add LICENCE