Finally figured out problem 23! Used a different approach.