clean up gaussian code a bit