added code to insert locations