This looks like it does the job perfectly... although I'm not exactly sure what its doing fully. Hopefully this kinda thing will come more naturally as I get better, this is only my first attempt! Thanks