perlin: added legal header and fixed pep8 compliance