adding copyright & complete some functions