Re-worked to use arrays to cut down amount of code needed, from 38 to 24 lines. Much DRYer now.