My entry for the 2012 JS1K competition