implemented functions, and tested
merged test.tig