Some code that you might like martin.