better version, client, addTR tested
database->select need more work