Some clean up, and addition of geometric recovery function