imported sqlite3 and os. added code to generate pid.  Fixed some bugs introduced to main.oy