added copyright notice, some comments