changed table design, added multi qry on subroutine