Note: This is off the top of my head, I haven't tested it to be valid code!!