Addressed review comment: Removed unnecessary variables
Replace Psycopg2 with pg800