improvements to algorithms
gwelliannau i algorithmau