added gettrivia()

refactored connect() into its own function