FINALLY solved #5!! - Not very elegant, but works.