added some comments and changed or_where in database