implemented functions 10,11,12 without tests 1,8,9,13 with tests