FInal version of insert queries