tiny changes to speedup program