Fixed minor errors in friends()
Added main database creation and adding friends to the main database.