Creates method to insert into database