Figured out a simpler solution