Added the actionscript version (the original)