New code reproduces same result as with nlgeom = 1

Need to clean up now