working version of composition insertion