added many functions. updated tester