Rewrote down to 13 lines of good, started at 50 lines with double for loops, now short and sweet and ready for testing.