It took some time but I think I figured it out.