adding diff for flatten