added in licence and minor bugfix