updated insert_study function
Finished insert_study function