db almost finished except select