Thanks to retronewfoundland for providing me with this.I had to split this into two parts for length reasons.