added index, start of database functionality