My entry for 2014's js1k comp