osmosis update function SQL

updated version of the osmosis update function and tables