finished assigment 3 - code