many improvements to scan gui and connection to pg db