Bug fix for return value
Adding insert_before function and test code for it