added a visits counter and updated database structure