Thread:Pecoes/@comment-47881-20121001174846/@comment-5209426-20121001190801

http://pastebin.com/FEHWv40w

Try that. I haven't tested it properly but it should be close to what you want.