added copyright and fixed comments