Added code to lock ends together