The whole thing is rather a hack. I apologise for my messy code!
However it is better to have somthing that works than nothing at all
and may inspire someone to do it better!

I take no responsibilty for this code at all. Do what you want with it.
