Finished transition function on problem 3b