completed test code for tma02 q2 and finished library code