Code to pass test 1 and 3