final solution

works i think