working, but with memory fault after a few iterationsgit status