Removes side elements in correct order