completed updating stored procedures and db structure