A bit of metaprogramming... learnt something today... :-)