sped up gauss code