Modified to check if sqlite3 is installed before installing, and cleaning up afterwards.