added peer functions
streamlined table creation and added unique index
added some storing of credit